{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">

                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="key" class="layui-input search" name="key" value="" placeholder="昵称|手机|公司名称"/>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select name="comid" id="role" lay-search="">
                                <option  value="">不限公司</option>
                                {foreach name="company" item="vo"}
                                <option  value="{$vo.id}">{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                        <div class="layui-col-md6 layui-input-inline">
                            <select name="sheng" lay-search="" id="province"  lay-filter="province">
                                <option value="">---- 请选择省 ----</option>
                                {foreach name="province" item="v1"}
                                <option value="{$v1.district_id}" >{$v1.district}</option>
                                {/foreach}
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <select name="shi" lay-search=""  id="city"  lay-filter="city">
                                <option value="">---- 请选择市 ----</option>
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <select name="qu" lay-search=""  id="district"  lay-filter="district">
                                <option value="">---- 请选择区 ----</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
                <!--操作框开始-->
                <!--<div class="col-sm-12">-->
                    <!--<div class="input-group" >-->
                        <!--<button class="btn btn-primary" type="button" onclick="wk.href('{:url('brokerAdd')}');">-->
                            <!--<i class="fa fa-plus"></i> 添加经纪人-->
                        <!--</button>-->
                    <!--</div>-->
                <!--</div>-->
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>

                    <!--图片模板-->
                    <script type="text/html" id="imgTpl">
                        <img src="{{d.user_image}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                    </script>

                    <script type="text/html" id="imgTpl1">
                        <img src="{{d.user_zheng}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                    </script>

                    <script type="text/html" id="imgTpl2">
                        <img src="{{d.user_fan}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                    </script>

                    <script type="text/html" id="imgTpl3">
                        <img src="{{d.user_card}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                    </script>

                    <script type="text/html" id="imgTpl4">
                        <img src="{{d.user_zhizhao}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                    </script>

                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        <a href="javascript:;" onclick="wk.href('{:url('brokerEdit')}?id={{d.user_id}}')" class="btn btn-primary btn-xs m-r-xs" title="编辑"><i class="fa fa-pencil"></i></a>
                        <a href="javascript:;" onclick="wk.layer_show('案例','{:url('cases')}?user_id={{d.user_id}}',1000)" class="btn btn-warning btn-xs m-r-xs" title="案例">案例</a>
                        <a href="javascript:;" onclick="wk.confirm('{{d.user_id}}','{:url('brokerDel')}')" class="btn btn-danger btn-xs m-r-xs" title="删除"><i class="fa fa-trash-o"></i></a>
                    </script>

                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Broker/designs")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
//                {type: 'checkbox', fixed: 'left',}
                  {type:'numbers', width: 80, title: '序号'}
                , {field: 'user_username', width: 110, title: '用户名称', align: 'center'}
                , {field: 'user_image', width: 70, title: '头像', align: 'center', templet: '#imgTpl'}
                , {field: 'user_zheng', width: '', title: '身份证正面', align: 'center', templet: '#imgTpl1'}
                , {field: 'user_fan', width: '', title: '身份证反面', align: 'center', templet: '#imgTpl2'}
                , {field: 'user_card', width: 70, title: '名片', align: 'center', templet: '#imgTpl3'}
                , {field: 'user_zhizhao', width: '', title: '营业执照', align: 'center', templet: '#imgTpl4'}
                , {field: 'user_phone', width: 120, title: '联系方式', align: 'center'}
                , {field: 'user_shop', width: '', title: '公司名称', align: 'center'}
                , {field: 'sheng', width: '80', title: '省', align: 'center'}
                , {field: 'shi', width: '80', title: '市', align: 'center'}
                , {field: 'qu', width: '80', title: '区', align: 'center'}
                , {fixed: 'right', width: 140, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });
    });
</script>
</body>
</html>